﻿using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using Xunit.DependencyInjection.AspNetCoreTesting;
using Xunit.DependencyInjection.Logging;
[assembly: CollectionBehavior(DisableTestParallelization
    = true)]
namespace TestProject1
{

    public class Startup
    {
        public void ConfigureHost(IHostBuilder hostBuilder) =>
            hostBuilder.ConfigureWebHost(webHostBuilder => webHostBuilder
                .UseTestServerAndAddDefaultHttpClient()
                .UseStartup<AspNetCoreStartup>());

        private class AspNetCoreStartup
        {
            public void ConfigureServices(IServiceCollection services)
            {
                  services.AddLogging(lb => lb.AddXunitOutput());
            }
            //public void Configure(IApplicationBuilder app) =>
            //    app.Run(static context => context.Response.WriteAsync(TestServerTest.Key));
        }
    }
}
